// const db = require('../../../db/index')
const { resContError, resContSuccess } = require('../../responseControl')
const { queryPackBySeries, querySeries } = require('../../../utils/queryCards/index')

//查系列
queryS = async (ctx, next) => {
  try {
    let result = await querySeries()
    resContSuccess(ctx, { series: result })
  } catch (error) {
    resContError(ctx, error)
  }
}
//根据系列查卡包
queryPByS = async (ctx, next) => {
  let { series } = ctx.request.query
  try {
    let result = await queryPackBySeries(series)
    // console.log(result);
    resContSuccess(ctx, { pack: result })
  } catch (error) {
    resContError(ctx, error.message)
  }
}

module.exports = {
  queryPByS, queryS
}